<template>
  <a-card :bordered='false' class='card-area'>
    <!-- 查询区域 11111-->
    <div class='table-page-search-wrapper'>
      <a-form layout='inline' :label-col='labelCol' @keyup.enter.native='searchQuery'>
        <a-row :gutter='24'>
          <a-col :md='6' :sm='8'>
            <a-form-item label='客户姓名'>
              <a-input placeholder='请输入客户姓名' v-model='queryParam.patientName'></a-input>
            </a-form-item>
          </a-col>
          <a-col :md='6' :sm='10'>
            <a-form-item label='签约时间' prop='signTime'>
              <a-date-picker clearable
                             v-model='queryParam.signTime'
                             type='date'
                             format='YYYY-MM-DD'
                             placeholder='请选择签约时间'>
              </a-date-picker>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="确认状态" style="margin-left:8px">
              <a-select placeholder="请选择确认状态" v-model="queryParam.confirmStatus">
                <a-select-option value="">请选择</a-select-option>
                <a-select-option value="0">未确认</a-select-option>
                <a-select-option value="1">已确认</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
           <a-col :md='6' :sm='24'>
               <a-button type='primary' @click='searchQuery' icon='search'>查询</a-button>
               <a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>
           </a-col>
        </span>
        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class='table-operator'>
<!--      <a-button @click='handleAdd' type='primary' icon='plus'>新增</a-button>-->
<!--      <a-button type='primary' icon='download' @click='handleExportXls'>导出</a-button>-->
<!--      <a-upload name='file' :showUploadList='false' :multiple='false' :action='importExcelUrl'-->
<!--                @change='handleImportExcel'>-->
<!--        <a-button type='primary' icon='import'>导入</a-button>-->
<!--      </a-upload>-->
<!--      <a-dropdown v-if='selectedRowKeys.length > 0'>-->
<!--        <a-menu slot='overlay'>-->
<!--          <a-menu-item key='1' @click='batchDel'>-->
<!--            <a-icon type='delete' />-->
<!--            删除-->
<!--          </a-menu-item>-->
<!--        </a-menu>-->
<!--        <a-button style='margin-left: 8px'> 批量操作-->
<!--          <a-icon type='down' />-->
<!--        </a-button>-->
<!--      </a-dropdown>-->
    </div>

    <!-- table区域-begin -->
    <div>
      <div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'>
        <i class='anticon anticon-info-circle ant-alert-icon'></i>
        <span>已选择</span>
        <a style='font-weight: 600'>
          {{ selectedRowKeys.length }}
        </a>
        <span>项</span>
        <a style='margin-left: 24px' @click='onClearSelected'>清空</a>
      </div>

      <a-table
        ref='table'
        size='middle'
        bordered
        rowKey='id'
        :columns='columns'
        :dataSource='dataSource'
        :pagination='ipagination'
        :loading='loading'
        @change='handleTableChange'>
        <span slot='action' slot-scope='text, record'>
          <a @click='postSubmit(record.id,"确认确认订单接受，开始执行订单服务","/store/order/service/confirm")' v-if='record.confirmStatus==0'>待确认</a>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <HHisPatientServiceSigned-modal ref='modalForm' @ok='modalFormOk'></HHisPatientServiceSigned-modal>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import HHisPatientServiceSignedModal from './modules/HHisPatientServiceSignedModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { putAction, getAction, postAction } from '@/api/manage'
import { frozenBatch } from '@/api/api'

export default {
  name: 'h_his_patient_service_signedList',
  mixins: [JeecgListMixin],
  components: {
    HHisPatientServiceSignedModal
  },
  data() {
    return {
      description: '患者服务签约管理页面',
      labelCol: { style: { width: '110px' } },
      queryParam: {
        //订单类型  1上门护理 2居家照护 3陪诊服务 4康复服务 5 心血管测评
        orderType: '5'
      },
      // 表头
      columns: [
        {
          title: '所属机构',
          align: 'center',
          dataIndex: 'tenantName',
          width: 120
        },
        {
          title: '客户姓名',
          align: 'center',
          dataIndex: 'patientName',
          width:130,
        },
        {
          title: '测评时间',
          align: 'center',
          dataIndex: 'testTime',
          width:140,
        },
        {
          title: '风险等级',
          align: 'center',
          dataIndex: 'risk',
          width:130,
        },
        {
          title: '配套服务',
          align: 'center',
          dataIndex: 'project',
          width:150,
        },
        {
          title: '费用(元)',
          align: 'center',
          dataIndex: 'amount',
          width:130,
        },
        {
          title: '支付状态',
          align: 'center',
          dataIndex: 'status',
          customRender:function (t,r,index) {
            return t=='0'?"未支付":"1已支付"
          },
          width:110,
        },
        {
          title: '支付时间',
          align: 'center',
          dataIndex: 'signProjectId',
          width:130,
        },
        {
          title: '订单创建时间',
          align: 'center',
          dataIndex: 'createTime',
          width:130,
        },
        {
          title: '确认状态',
          align: 'center',
          dataIndex: 'confirmStatus',
          customRender:function (t,r,index) {
            return t=='0'?"未确认":"已确认"
          },
          width:120,
        },

        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
          width:100,
        }
      ],
      url: {
        list: '/store/order/service/list/evaluation',
      }
    }
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>